﻿<?php
include("../public_files/conn.php");
require_once("person_info.php");
session_start();


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<meta content="IE=EmulateIE7" http-equiv="X-UA-Compatible"/>
<meta name="keywords" content=""/><!--SEO关键字-->
<meta name="description" content=""/><!--SEO描述-->
<link rel ="" href=""/><!--选项卡图标-->
<title></title>
<link rel="stylesheet" href="../css/base.css"/>
<link rel="stylesheet" href="../css/all_header.css"/>
<link rel="stylesheet" href="../css/person_info.css"/>
<script type="text/javascript" src="../js/jquery-1.7.2.js"></script>
<script type="text/javascript" src="../js/check.js"></script>
<script type="text/javascript" src="../js/all_header.js"></script>
<script type="text/javascript" src="../js/person_info.js"></script>
<script type="text/javascript" src="../js/search.js"></script>


<!--[if lt IE 9]>
<script src="../js/html5shiv.js"></script>
<![endif]-->
<!--[if ie 6]>
<link rel="stylesheet" href="../css/ie6.css">
<script type="text/javascript" src="../js/DD_belatedPNG.js" ></script>
<script type="text/javascript">
DD_belatedPNG.fix('.png');/*在需要png透明的元素里面加上.png样式即可（class="png"）*/
</script>
<![endif]-->
</head>
<body>				<!--滑动注册登录框-->
	 <div class="slide_box">
		<div class="slide_login">
				<span>邮箱:</span><br/>
				<input type="text" id="email"  onblur="cheak_email(this)" class="required" value="" style="width:219px;height:29px;border:0px;background:#333;color:#ddd;"/>
					<br/><br/>
				<span>密码:</span><br/>
				<input type="password"  value="" id="password"  style="width:219px;height:29px;border:0px;background:#333;color:#ddd;"/>
				<div class="text1">
					<div class="text2"><span>还没账号？</span><span onclick="show_regesit();">注册<span></div>
				<div class="login_btn"><input type="button" onclick="login(),cheak_email('#email') "name="submit" id="send" value="登录" style="width:70px;height:29px;background:#333;border:0px;color:#999;"></div>
				</div>
			
		</div>
		
		<div class="slide_regesit">
				<span>昵称:</span><br/>
				<input type="text" id="Username" name="username" value="" style="width:219px;height:29px;border:0px;background:#333;color:#ddd;"/>
					<label class="stats1">请输入用户名</label><br/>
				<br/><span>邮箱:</span><br/>
				<input type="text"name="email" id="Email" value="" style="width:219px;height:29px;border:0px;background:#333;color:#ddd;"/>
					<label class="stats1">请输入邮箱</label><br/>
				<br/><span>密码:</span><br/>
				<input type="password"id="Password" name="password" value="" style="width:219px;height:29px;border:0px;background:#333;color:#ddd;"/>
				<label class="stats1">请输入用户密码</label>
				<div class="text1">
					<div class="text2"><input type="checkbox" name="agreement" id="agreement"/><a>&nbsp;同意服务条款</a><br/><label>&nbsp;请阅读并同意服务条款</label></div>
					<div class="reg_btn"><input type="button"name="sub" onclick="regs('click'),register()" value="注册" style="width:70px;height:29px;background:#333;border:0px;color:#999;"></div>
				</div>
		</div>
	</div>
	<!--触发下拉框按钮-->
	<div class="slide_btn"  onclick="slide_btn();"><img class="png" src="../images/arrow_down.png"/></div>
	<!--主体-->
	<div class="container_12">
		<div class="header">
			<div class="logo"style="display:inline;float:left;">
				<img class="png" src="../images/TopWhole_logo.png"/>
			</div>
			<!--创建榜单按钮-->
			<div class="creat_list_btn"style="display:inline;float:left;margin:20px auto;">
				<input type="button" onclick="openNewDiv();" style="background:url(../images/creat_list_btn.png);width:140px;height:72px;border:0px;"/>
			</div>
			<div class="search">
				<div class="un_useful_4">
					<form action="../public_files/show_search.php" method="post" id="search_start">
					<input type="text" id="search_box" name="search" value="" onblur="hide_result()" oninput="cheak(this)" style="width:193px;height:25px;"/>
					
					<a href="#"><input type="submit" id="Submit" name="submit" style="background:url(../images/search_btn.png);width:17px;height:17px;border:0px;" value=""/></a>
				</form>
				</div>
				<div class="l_r_text">
				<?php if(isset($_SESSION['username'])){
				echo '<div class="un_useful_5">
						<span class="log_tetx" > <a href="complete_list.php">'.$_SESSION['username'].'</a></span>
					</div>
					<div class="un_useful_6">
						<span class="un_useful_7"> | </span>
						<span class="reg_text" onclick="destroy()">退出</span>
					</div>';
				}else{ ?>
								<div class="un_useful_5">
						<span class="log_tetx" onclick="slide_btn();"> 登录 </span>
					</div>
					<div class="un_useful_6">
						<span class="un_useful_7"> | </span>
						<span class="reg_text" onclick="regesit_btn();"> 注册 </span>
					</div>
			<?php } ?>

				</div>
				<!--个人信息-->
				<div class="person_info">
					<div class="un_useful_61">
						<img style="width:48;height:48px;"src="../images/p3.gif">
					</div>
					<div class="un_useful_51"><a href="#">用户名用户名用户</a></div>
				</div>
				<div class="search_result"></div> 
			</div>
			<div class="nav">
				<ul>
					<li class="index"><a href="index.php" >主页</a></li>
					<li class="music"><a href="../music/music_home.php">音乐</a></li>
					<li class="movie"><a href="movie_home.php">影视</a></li>
					<li class="sport"><a href="sport_home.php">运动</a></li>
					<li class="funny"><a href="funny_home.php">趣味</a></li>
					<li class="people"><a href="people_home.php">人物</a></li>
					<li class="travel"><a href="travel_home.php">旅游</a></li>
					<li class="book"><a href="book_home.php">书籍</a></li>
					<li class="diet"><a href="diet_home.php">饮食</a></li>
					<li class="science"><a href="science_home.php">科技</a></li>
					<li class="other"><a href="other.php">其它</a></li>
				</ul>
			</div>
		</div>
		<div style="clear:both;"></div>
		
						<!--创建榜单弹出遮罩层-->
	<div id="list_name_input"style="background:url(../images/bg_body.gif);width:576px;height:258px;">
		<span style="color:blue;float:right;font:bold 15px 微软雅黑;padding:10px;cursor:pointer;"onclick="btn_close();">X</span>
		<div class="input_logo" style="background:url(../images/list_input_name.gif);width:173px;height:174px;clear:both;margin-top:50px;margin-left:30px;">
		</div>
		<div class="input_12" style="float:right;margin-top:-110px">
			<input type="text"style="background:url(../images/input.gif);width:306px;height:38px;border:0px;"/>
			<select style="width:55px;height:20px;font-size:15px;">
				<option>音乐</option>
				<option>趣味</option>
				<option>人物</option>
				<option>电影</option>
			</select><br/>
			<span style="font-size:12px;color:#838383;">你也可以稍后再填写</span>
		</div>
		<div class="next_btn"style="float:right;padding-right:58px;">
			<input type="button" value="下一步"style="font-size:15px;color:#fff;background:#43b7eb;width:79px;height:32px;border:0px;"/>
		</div>
	</div>
		
		
		<div class="container_12">
			<div class="list_info">
				<div class="list_nav">
					<ul class="png" style="background:url(../images/vote.png);width:631px;height:43px;">
						<li><a href="complete_list.php">已完成</a></li>
						<li><a href="vote_list.php">已投票</a></li>
						<li><a href="attention.php">已关注</a></li>
						<li><a href="save_list.php">已保存</a></li>
						<li><a href="message.php" class="list_nav_message">消息</a></li>
					</ul>
				</div>
				<!--已关注的人数-->
				<div class="num">
					<div class="icon_smlie" class="png" style="background:url(../images/icon_vote.png);"></div>
					<div class="attention_num">
						<span>已投票 : <span id="total"><?php echo total();?></span></span>
					</div>
				</div>
				<div class="complete_list">
				<!--已投票榜单-->

					<?php show_vote_old();?>
				</div>
			</div>
			<div class="info">
				<div class="info_content">
					<div class="user_name">
						<span><?php echo $_SESSION['username']?></span>
					</div>
					<?php 
							if(isset($_SESSION['photo_path'])){
									$photo_path=$_SESSION['photo_path'];
								}else{
									$photo_path=null; 
								}
									if($photo_path==null){ 
							?>
					<div class="user_photo" >
						<img onclick="upload_photo()"src="../images/add_user_photo.gif">
					</div>

					<div class="upload_photo">
					<form id="photo_form" action="upload_photo.php" method="post" target="upframe" enctype="multipart/form-data">
						<input type="file" name="up_photo" style="margin:10px auto;width:250px;float:right;"/>
						<input class="sure_upload" type="submit" name="submit_up" onclick="submit_photo()"value="确定" style="float:right;width:65px;margin:0px 29px 10px"/>
					</form>
					</div>
					<iframe class="upframe" style="display:none;" src="upload_photo.php" name="upframe">
					</iframe>
					<?php }else{ ?>
					
					<div class="user_photo" >
						<img src="../<?php echo $photo_path ;?>">
					</div>
					
					<?php } ?>
					<br/>
					<div class="release_popular">
						<div class="relea_pop">
							<span>已发布 : </span><span> <?php listnum(); ?></span><br/>
							<span>人气值 : </span><span> <?php fans(); ?></span>
						</div>
						<div class="atte_btn"class="png">
						
						</div>
					</div>
				</div>
			</div>
		</div>		
	<div style="DISPLAY: none" id=goTopBtn><img border=0 src="../images/go_top.png"></div>
	<script type="text/javascript">goTopEx();</script>
</body>
</html>



<?php
function total(){
$user_id=$_SESSION['userid'];
$count_vote=0;
$sql="select  * from already_vote where user_id='$user_id' order by id desc";
$result=mysql_query($sql)or die(mysql_error());
while($rows=mysql_fetch_array($result)){
		if($rows['offi_or_user']==0){
			$tabel="official_list_name";
			
		}else if($rows['offi_or_user']==1){
			$tabel="user_list_name";
	
		}


$list_id=$rows['list_id'];
$sqla="select  * from ".$tabel." where id='$list_id' ";
$resulta=mysql_query($sqla)or die(mysql_error());
$rowa=mysql_fetch_array($resulta);
		$status=$rowa['status'];
	if( $status==0 ){
		$count_vote++;
	}

}
echo $count_vote."个";
}


function show_vote_old(){


		$user_id=$_SESSION['userid'];
		$sqls="select * from  already_vote where user_id='$user_id'";
		$results=mysql_query($sqls)or die(mysql_error());
		while($row=mysql_fetch_array($results)){
		
		if($row['offi_or_user']==0){
			$tabel="official_list_name";
			
		}else if($row['offi_or_user']==1){
			$tabel="user_list_name";
			
		}



				$sql="select * from ".$tabel." where id=".$row['list_id']." and status ='0'";
				$result=mysql_query($sql)or die(mysql_error());
				if($rows=mysql_fetch_array($result)){

		?>

						<div id="vote<?php echo $rows['id']; ?>" class="list_1" onmouseover="show_detelt_btn_Com(<?php echo $rows['id']; ?><?php echo $row['offi_or_user']; ?>)"onmouseout="hide_detelt_btn_Com(<?php echo $rows['id']; ?><?php echo $row['offi_or_user']; ?>)">
						<div class="person_pic">
							<img style="width:70px;height:70px;"src="../image/<?php echo $rows['img_path']; ?>">
						</div>
						<div class="list_name_or_btn_Com">
							<div class="list_name_Com">
								<div class="list">
									<a href="../music/MusicListContent.php?listname_id=<?php echo $rows['id'];?>&type=<?php echo $row['offi_or_user'];?>&sort_id=<?php echo $rows['list_sort_id'];?>"><?php echo $rows['list_name']; ?></a>
								</div>
								<div class="browse_vote_date">
									<span>浏览量 : </span>
									<label><?php echo $rows['browse_num']; ?> </label>
									<span>投票量 : </span>
									<label><?php echo $rows['vote_total']; ?></label>
									<span>制作时间 : </span>
									<label><?php echo $rows['create_time']; ?></label>
								</div>
							</div>
							<div class="chang_detele_list_Com" id="com<?php echo $rows['id']; ?><?php echo $row['offi_or_user']; ?>">
								<div class="detele_btn_Com">
									<input type="button"class="png" style="background:url(../images/detele_btn.png);width:50px;height:17px;border:0px;" onclick="delete_vote(<?php echo $rows['id']; ?>)">
								</div>
							</div>
						</div>
					</div>
		<?php
				}
			}
	
}
?>



